package com.example.blogsystem.service.impl;

import com.example.blogsystem.mapper.BlogMapper;
import com.example.blogsystem.model.vo.BlogVo;
import com.example.blogsystem.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogServiceImpl implements BlogService {

    @Autowired
    private BlogMapper blogMapper;

    @Override
    public List<BlogVo> queryAllBlogs() {
        List<BlogVo> blogVos = blogMapper.selectAllBlogs();
        return blogVos;
    }

    @Override
    public BlogVo queryBlogById(Integer blogId) {
        BlogVo blogVo = blogMapper.selectById(blogId);
        return blogVo;
    }
}
